home *** CD-ROM | disk | FTP | other *** search
/ Komputer for Alle 1999 #5 / 1999 CD 5 (black).iso / Delphi3 / install / data.z / SYSTEM.INT < prev    next >
Encoding:
Text File  |  1997-08-05  |  25.2 KB  |  757 lines

  1. {*******************************************************}
  2. {                                                       }
  3. {       Delphi Runtime Library                          }
  4. {       System Unit                                     }
  5. {                                                       }
  6. {       Copyright (C) 1988,97 Borland International     }
  7. {                                                       }
  8. {*******************************************************}
  9.  
  10. unit System;
  11.  
  12. {$H+,I-,S-}
  13.  
  14. interface
  15.  
  16. const
  17.  
  18. { Variant type codes }
  19.  
  20.   varEmpty    = $0000;
  21.   varNull     = $0001;
  22.   varSmallint = $0002;
  23.   varInteger  = $0003;
  24.   varSingle   = $0004;
  25.   varDouble   = $0005;
  26.   varCurrency = $0006;
  27.   varDate     = $0007;
  28.   varOleStr   = $0008;
  29.   varDispatch = $0009;
  30.   varError    = $000A;
  31.   varBoolean  = $000B;
  32.   varVariant  = $000C;
  33.   varUnknown  = $000D;
  34.   varByte     = $0011;
  35.   varString   = $0100;
  36.   varTypeMask = $0FFF;
  37.   varArray    = $2000;
  38.   varByRef    = $4000;
  39.  
  40. { TVarRec.VType values }
  41.  
  42.   vtInteger    = 0;
  43.   vtBoolean    = 1;
  44.   vtChar       = 2;
  45.   vtExtended   = 3;
  46.   vtString     = 4;
  47.   vtPointer    = 5;
  48.   vtPChar      = 6;
  49.   vtObject     = 7;
  50.   vtClass      = 8;
  51.   vtWideChar   = 9;
  52.   vtPWideChar  = 10;
  53.   vtAnsiString = 11;
  54.   vtCurrency   = 12;
  55.   vtVariant    = 13;
  56.   vtInterface  = 14;
  57.   vtWideString = 15;
  58.  
  59. { Virtual method table entries }
  60.  
  61.   vmtSelfPtr           = -64;
  62.   vmtIntfTable         = -60;
  63.   vmtAutoTable         = -56;
  64.   vmtInitTable         = -52;
  65.   vmtTypeInfo          = -48;
  66.   vmtFieldTable        = -44;
  67.   vmtMethodTable       = -40;
  68.   vmtDynamicTable      = -36;
  69.   vmtClassName         = -32;
  70.   vmtInstanceSize      = -28;
  71.   vmtParent            = -24;
  72.   vmtSafeCallException = -20;
  73.   vmtDefaultHandler    = -16;
  74.   vmtNewInstance       = -12;
  75.   vmtFreeInstance      = -8;
  76.   vmtDestroy           = -4;
  77.  
  78.   vmtQueryInterface    = 0;
  79.   vmtAddRef            = 4;
  80.   vmtRelease           = 8;
  81.   vmtCreateObject      = 12;
  82.  
  83. type
  84.  
  85.   TObject = class;
  86.  
  87.   TClass = class of TObject;
  88.  
  89.   PGUID = ^TGUID;
  90.   TGUID = record
  91.     D1: Integer;
  92.     D2: Word;
  93.     D3: Word;
  94.     D4: array[0..7] of Byte;
  95.   end;
  96.  
  97.   PInterfaceEntry = ^TInterfaceEntry;
  98.   TInterfaceEntry = record
  99.     IID: TGUID;
  100.     VTable: Pointer;
  101.     IOffset: Integer;
  102.   end;
  103.  
  104.   PInterfaceTable = ^TInterfaceTable;
  105.   TInterfaceTable = record
  106.     EntryCount: Integer;
  107.     Entries: array[0..9999] of TInterfaceEntry;
  108.   end;
  109.  
  110.   TObject = class
  111.     constructor Create;
  112.     procedure Free;
  113.     class function InitInstance(Instance: Pointer): TObject;
  114.     procedure CleanupInstance;
  115.     function ClassType: TClass;
  116.     class function ClassName: ShortString;
  117.     class function ClassNameIs(const Name: string): Boolean;
  118.     class function ClassParent: TClass;
  119.     class function ClassInfo: Pointer;
  120.     class function InstanceSize: Longint;
  121.     class function InheritsFrom(AClass: TClass): Boolean;
  122.     procedure Dispatch(var Message);
  123.     class function MethodAddress(const Name: ShortString): Pointer;
  124.     class function MethodName(Address: Pointer): ShortString;
  125.     function FieldAddress(const Name: ShortString): Pointer;
  126.     function GetInterface(const IID: TGUID; out Obj): Boolean;
  127.     class function GetInterfaceEntry(const IID: TGUID): PInterfaceEntry;
  128.     class function GetInterfaceTable: PInterfaceTable;
  129.     function SafeCallException(ExceptObject: TObject;
  130.       ExceptAddr: Pointer): Integer; virtual;
  131.     procedure DefaultHandler(var Message); virtual;
  132.     class function NewInstance: TObject; virtual;
  133.     procedure FreeInstance; virtual;
  134.     destructor Destroy; virtual;
  135.   end;
  136.  
  137.   IUnknown = interface
  138.     ['{00000000-0000-0000-C000-000000000046}']
  139.     function QueryInterface(const IID: TGUID; out Obj): Integer; stdcall;
  140.     function _AddRef: Integer; stdcall;
  141.     function _Release: Integer; stdcall;
  142.   end;
  143.  
  144.   IDispatch = interface(IUnknown)
  145.     ['{00020400-0000-0000-C000-000000000046}']
  146.     function GetTypeInfoCount(out Count: Integer): Integer; stdcall;
  147.     function GetTypeInfo(Index, LocaleID: Integer; out TypeInfo): Integer; stdcall;
  148.     function GetIDsOfNames(const IID: TGUID; Names: Pointer;
  149.       NameCount, LocaleID: Integer; DispIDs: Pointer): Integer; stdcall;
  150.     function Invoke(DispID: Integer; const IID: TGUID; LocaleID: Integer;
  151.       Flags: Word; var Params; VarResult, ExcepInfo, ArgErr: Pointer): Integer; stdcall;
  152.   end;
  153.  
  154.   TInterfacedObject = class(TObject, IUnknown)
  155.   protected
  156.     function QueryInterface(const IID: TGUID; out Obj): Integer; stdcall;
  157.     function _AddRef: Integer; stdcall;
  158.     function _Release: Integer; stdcall;
  159.   public
  160.     property RefCount: Integer;
  161.   end;
  162.  
  163.   TInterfacedClass = class of TInterfacedObject;
  164.  
  165.   TVarArrayBound = record
  166.     ElementCount: Integer;
  167.     LowBound: Integer;
  168.   end;
  169.  
  170.   PVarArray = ^TVarArray;
  171.   TVarArray = record
  172.     DimCount: Word;
  173.     Flags: Word;
  174.     ElementSize: Integer;
  175.     LockCount: Integer;
  176.     Data: Pointer;
  177.     Bounds: array[0..255] of TVarArrayBound;
  178.   end;
  179.  
  180.   PVarData = ^TVarData;
  181.   TVarData = record
  182.     VType: Word;
  183.     Reserved1, Reserved2, Reserved3: Word;
  184.     case Integer of
  185.       varSmallint: (VSmallint: Smallint);
  186.       varInteger:  (VInteger: Integer);
  187.       varSingle:   (VSingle: Single);
  188.       varDouble:   (VDouble: Double);
  189.       varCurrency: (VCurrency: Currency);
  190.       varDate:     (VDate: Double);
  191.       varOleStr:   (VOleStr: PWideChar);
  192.       varDispatch: (VDispatch: Pointer);
  193.       varError:    (VError: Integer);
  194.       varBoolean:  (VBoolean: WordBool);
  195.       varUnknown:  (VUnknown: Pointer);
  196.       varByte:     (VByte: Byte);
  197.       varString:   (VString: Pointer);
  198.       varArray:    (VArray: PVarArray);
  199.       varByRef:    (VPointer: Pointer);
  200.   end;
  201.  
  202.   PShortString = ^ShortString;
  203.   PAnsiString = ^AnsiString;
  204.   PWideString = ^WideString;
  205.   PString = PAnsiString;
  206.  
  207.   PExtended = ^Extended;
  208.   PCurrency = ^Currency;
  209.   PVariant = ^Variant;
  210.  
  211.   TDateTime = type Double;
  212.  
  213.   PVarRec = ^TVarRec;
  214.   TVarRec = record
  215.     case Byte of
  216.       vtInteger:    (VInteger: Integer; VType: Byte);
  217.       vtBoolean:    (VBoolean: Boolean);
  218.       vtChar:       (VChar: Char);
  219.       vtExtended:   (VExtended: PExtended);
  220.       vtString:     (VString: PShortString);
  221.       vtPointer:    (VPointer: Pointer);
  222.       vtPChar:      (VPChar: PChar);
  223.       vtObject:     (VObject: TObject);
  224.       vtClass:      (VClass: TClass);
  225.       vtWideChar:   (VWideChar: WideChar);
  226.       vtPWideChar:  (VPWideChar: PWideChar);
  227.       vtAnsiString: (VAnsiString: Pointer);
  228.       vtCurrency:   (VCurrency: PCurrency);
  229.       vtVariant:    (VVariant: PVariant);
  230.       vtInterface:  (VInterface: Pointer);
  231.       vtWideString: (VWideString: Pointer);
  232.   end;
  233.  
  234.   PMemoryManager = ^TMemoryManager;
  235.   TMemoryManager = record
  236.     GetMem: function(Size: Integer): Pointer;
  237.     FreeMem: function(P: Pointer): Integer;
  238.     ReallocMem: function(P: Pointer; Size: Integer): Pointer;
  239.   end;
  240.  
  241.   THeapStatus = record
  242.     TotalAddrSpace: Cardinal;
  243.     TotalUncommitted: Cardinal;
  244.     TotalCommitted: Cardinal;
  245.     TotalAllocated: Cardinal;
  246.     TotalFree: Cardinal;
  247.     FreeSmall: Cardinal;
  248.     FreeBig: Cardinal;
  249.     Unused: Cardinal;
  250.     Overhead: Cardinal;
  251.     HeapErrorCode: Cardinal;
  252.   end;
  253.  
  254.   PackageUnitEntry = record
  255.     Init, FInit : procedure;
  256.   end;
  257.  
  258.   { Compiler generated table to be processed sequentially to init & finit all package units }
  259.   { Init: 0..Max-1; Final: Last Initialized..0                                              }
  260.   UnitEntryTable = array [0..9999999] of PackageUnitEntry;
  261.   PUnitEntryTable = ^UnitEntryTable;
  262.  
  263.   PackageInfoTable = record
  264.     UnitCount : Integer;      { number of entries in UnitInfo array; always > 0 }
  265.     UnitInfo : PUnitEntryTable;
  266.   end;
  267.  
  268.   PackageInfo = ^PackageInfoTable;
  269.  
  270.   { Each package exports a '@GetPackageInfoTable' which can be used to retrieve }
  271.   { the table which contains compiler generated information about the package DLL }
  272.   GetPackageInfoTable = function : PackageInfo;
  273.  
  274. threadvar
  275.  
  276.   RaiseList: Pointer;     { Stack of current exception objects }
  277.   InOutRes: Integer;      { Result of I/O operations }
  278.  
  279. var
  280.  
  281.   ExceptProc: Pointer;    { Unhandled exception handler }
  282.   ErrorProc: Pointer;     { Error handler procedure }
  283.   ExceptClsProc: Pointer; { Map an OS Exception to a Delphi class reference }
  284.   ExceptObjProc: Pointer; { Map an OS Exception to a Delphi class instance }
  285.   ExceptionClass: TClass; { Exception base class (must be Exception) }
  286.   SafeCallErrorProc: Pointer; { Safecall error handler }
  287.   AssertErrorProc: Pointer; { Assertion error handler }
  288.   AbstractErrorProc: Pointer; { Abstract method error handler }
  289.   HPrevInst: Longint;     { Handle of previous instance }
  290.   MainInstance: Longint;  { Handle of the main(.EXE) HInstance }
  291.   IsLibrary: Boolean;     { True if module is a DLL }
  292.   CmdShow: Integer;       { CmdShow parameter for CreateWindow }
  293.   CmdLine: PChar;         { Command line pointer }
  294.   InitProc: Pointer;      { Last installed initialization procedure }
  295.   ExitCode: Integer;      { Program result }
  296.   ExitProc: Pointer;      { Last installed exit procedure }
  297.   ErrorAddr: Pointer;     { Address of run-time error }
  298.   RandSeed: Longint;      { Base for random number generator }
  299.   IsConsole: Boolean;     { True if compiled as console app }
  300.   IsMultiThread: Boolean; { True if more than one thread }
  301.   FileMode: Byte;         { Standard mode for opening files }
  302.   Test8086: Byte;         { Will always be 2 (386 or later) }
  303.   Test8087: Byte;         { Will always be 3 (387 or later) }
  304.   TestFDIV: Shortint;     { -1: Flawed Pentium, 0: Not determined, 1: Ok }
  305.   Input: Text;            { Standard input }
  306.   Output: Text;           { Standard output }
  307.  
  308.  
  309. var
  310.   Default8087CW: Word = $1332;{ Default 8087 control word.  FPU control
  311.                                 register is set to this value.
  312.                                 CAUTION:  Setting this to an invalid value
  313.                                           could cause unpredictable behaiour. }
  314.   HeapAllocFlags: Word = 2;   { Heap allocation flags, gmem_Moveable }
  315.   DebugHook: Byte = 0;        {  1 to notify debugger of non-Delphi exceptions
  316.                                  >1 to notify debugger of exception unwinding }
  317.  
  318. var
  319.   Unassigned: Variant;    { Unassigned standard constant }
  320.   Null: Variant;          { Null standard constant }
  321.  
  322.   AllocMemCount: Integer; { Number of allocated memory blocks }
  323.   AllocMemSize: Integer;  { Total size of allocated memory blocks }
  324.  
  325. { Memory manager support }
  326.  
  327. procedure GetMemoryManager(var MemMgr: TMemoryManager);
  328. procedure SetMemoryManager(const MemMgr: TMemoryManager);
  329. function IsMemoryManagerSet: Boolean;
  330.  
  331. function SysGetMem(Size: Integer): Pointer;
  332. function SysFreeMem(P: Pointer): Integer;
  333. function SysReallocMem(P: Pointer; Size: Integer): Pointer;
  334.  
  335. function GetHeapStatus: THeapStatus;
  336.  
  337. { Thread support }
  338. type
  339.   TThreadFunc = function(Parameter: Pointer): Integer;
  340.  
  341. function BeginThread(SecurityAttributes: Pointer; StackSize: Integer;
  342.                      ThreadFunc: TThreadFunc; Parameter: Pointer;
  343.                      CreationFlags: Integer; var ThreadId: Integer): Integer;
  344.  
  345. procedure EndThread(ExitCode: Integer);
  346.  
  347. { Standard procedures and functions }
  348.  
  349. procedure _ChDir(const S: string);
  350. procedure __Flush(var F: Text);
  351. procedure _LGetDir(D: Byte; var S: string);
  352. procedure _SGetDir(D: Byte; var S: ShortString);
  353. function IOResult: Integer;
  354. procedure _MkDir(const S: string);
  355. procedure Move(const Source; var Dest; Count: Integer);
  356. function ParamCount: Integer;
  357. function ParamStr(Index: Integer): string;
  358. procedure Randomize;
  359. procedure _RmDir(const S: string);
  360. function UpCase(Ch: Char): Char;
  361.  
  362. { Control 8087 control word }
  363.  
  364. procedure Set8087CW(NewCW: Word);
  365.  
  366. { Wide character support procedures and functions }
  367.  
  368. function WideCharToString(Source: PWideChar): string;
  369. function WideCharLenToString(Source: PWideChar; SourceLen: Integer): string;
  370. procedure WideCharToStrVar(Source: PWideChar; var Dest: string);
  371. procedure WideCharLenToStrVar(Source: PWideChar; SourceLen: Integer;
  372.   var Dest: string);
  373. function StringToWideChar(const Source: string; Dest: PWideChar;
  374.   DestSize: Integer): PWideChar;
  375.  
  376. { OLE string support procedures and functions }
  377.  
  378. function OleStrToString(Source: PWideChar): string;
  379. procedure OleStrToStrVar(Source: PWideChar; var Dest: string);
  380. function StringToOleStr(const Source: string): PWideChar;
  381.  
  382. { Variant support procedures and functions }
  383.  
  384. procedure _VarClear(var V : Variant);
  385. procedure _VarCopy(var Dest : Variant; const Source: Variant);
  386. procedure _VarCast(var Dest : Variant; const Source: Variant; VarType: Integer);
  387. procedure _VarCastOle(var Dest : Variant; const Source: Variant; VarType: Integer);
  388. function VarType(const V: Variant): Integer;
  389. function VarAsType(const V: Variant; VarType: Integer): Variant;
  390. function VarIsEmpty(const V: Variant): Boolean;
  391. function VarIsNull(const V: Variant): Boolean;
  392. function VarToStr(const V: Variant): string;
  393. function VarFromDateTime(DateTime: TDateTime): Variant;
  394. function VarToDateTime(const V: Variant): TDateTime;
  395.  
  396. { Variant array support procedures and functions }
  397.  
  398. function VarArrayCreate(const Bounds: array of Integer;
  399.   VarType: Integer): Variant;
  400. function VarArrayOf(const Values: array of Variant): Variant;
  401. procedure _VarArrayRedim(var A : Variant; HighBound: Integer);
  402. function VarArrayDimCount(const A: Variant): Integer;
  403. function VarArrayLowBound(const A: Variant; Dim: Integer): Integer;
  404. function VarArrayHighBound(const A: Variant; Dim: Integer): Integer;
  405. function VarArrayLock(const A: Variant): Pointer;
  406. procedure VarArrayUnlock(const A: Variant);
  407. function VarArrayRef(const A: Variant): Variant;
  408. function VarIsArray(const A: Variant): Boolean;
  409.  
  410. { Variant IDispatch call support }
  411.  
  412. procedure _DispInvokeError;
  413.  
  414. var
  415.   VarDispProc: Pointer = @_DispInvokeError;
  416.   DispCallByIDProc: Pointer = @_DispInvokeError;
  417.  
  418. { Package/Module registration and unregistration }
  419.  
  420. type
  421.   PLibModule = ^TLibModule;
  422.   TLibModule = record
  423.     Next: PLibModule;
  424.     Instance: Longint;
  425.     ResInstance: Longint;
  426.     Reserved: Integer;
  427.   end;
  428.  
  429.   TEnumModuleFunc = function (HInstance: Longint; Data: Pointer): Boolean;
  430.   TModuleUnloadProc = procedure (HInstance: Longint);
  431.  
  432.   PModuleUnloadRec = ^TModuleUnloadRec;
  433.   TModuleUnloadRec = record
  434.     Next: PModuleUnloadRec;
  435.     Proc: TModuleUnloadProc;
  436.   end;
  437.  
  438. var
  439.   LibModuleList: PLibModule = nil;
  440.   ModuleUnloadList: PModuleUnloadRec = nil;
  441.  
  442. procedure RegisterModule(LibModule: PLibModule);
  443. procedure UnregisterModule(LibModule: PLibModule);
  444. function FindHInstance(Address: Pointer): Longint;
  445. function FindClassHInstance(ClassType: TClass): Longint;
  446. function FindResourceHInstance(Instance: Longint): Longint;
  447. function LoadResourceModule(ModuleName: PChar): Longint;
  448. procedure EnumModules(Func: TEnumModuleFunc; Data: Pointer);
  449. procedure EnumResourceModules(Func: TEnumModuleFunc; Data: Pointer);
  450. procedure AddModuleUnloadProc(Proc: TModuleUnloadProc);
  451. procedure RemoveModuleUnloadProc(Proc: TModuleUnloadProc);
  452.  
  453. { ResString support function/record }
  454.  
  455. type
  456.   PResStringRec = ^TResStringRec;
  457.   TResStringRec = record
  458.     Module: ^Longint;
  459.     Identifier: Integer;
  460.   end;
  461.  
  462. function LoadResString(ResStringRec: PResStringRec): string;
  463.  
  464. { Procedures and functions that need compiler magic }
  465.  
  466. procedure _COS;
  467. procedure _EXP;
  468. procedure _INT;
  469. procedure _SIN;
  470. procedure _FRAC;
  471. procedure _ROUND;
  472. procedure _TRUNC;
  473.  
  474. procedure _AbstractError;
  475. procedure _Assert(const Message, Filename: AnsiString; LineNumber: Integer);
  476. procedure _Append;
  477. procedure _Assign(var T: Text; S: ShortString);
  478. procedure _BlockRead;
  479. procedure _BlockWrite;
  480. procedure _Close;
  481. procedure _PStrCat;
  482. procedure _PStrNCat;
  483. procedure _PStrCpy;
  484. procedure _PStrNCpy;
  485. procedure _EofFile;
  486. procedure _EofText;
  487. procedure _Eoln;
  488. procedure _Erase;
  489. procedure _FilePos;
  490. procedure _FileSize;
  491. procedure _FillChar;
  492. procedure _FreeMem;
  493. procedure _GetMem;
  494. procedure _ReallocMem;
  495. procedure _Halt;
  496. procedure _Halt0;
  497. procedure _Mark;
  498. procedure _PStrCmp;
  499. procedure _AStrCmp;
  500. procedure _RandInt;
  501. procedure _RandExt;
  502. procedure _ReadRec;
  503. procedure _ReadChar;
  504. procedure _ReadLong;
  505. procedure _ReadString;
  506. procedure _ReadCString;
  507. procedure _ReadLString;
  508. procedure _ReadExt;
  509. procedure _ReadLn;
  510. procedure _Rename;
  511. procedure _Release;
  512. procedure _ResetText(var T: Text);
  513. procedure _ResetFile;
  514. procedure _RewritText(var T: Text);
  515. procedure _RewritFile;
  516. procedure _RunError;
  517. procedure _Run0Error;
  518. procedure _Seek;
  519. procedure _SeekEof;
  520. procedure _SeekEoln;
  521. procedure _SetTextBuf;
  522. procedure _StrLong;
  523. procedure _Str0Long;
  524. procedure _Truncate;
  525. procedure _ValLong;
  526. procedure _WriteRec;
  527. procedure _WriteChar;
  528. procedure _Write0Char;
  529. procedure _WriteBool;
  530. procedure _Write0Bool;
  531. procedure _WriteLong;
  532. procedure _Write0Long;
  533. procedure _WriteString;
  534. procedure _Write0String;
  535. procedure _WriteCString;
  536. procedure _Write0CString;
  537. procedure _WriteLString;
  538. procedure _Write0LString;
  539. function _WriteVariant(var T: Text; const V: Variant; Width: Integer): Pointer;
  540. function _Write0Variant(var T: Text; const V: Variant): Pointer;
  541. procedure _Write2Ext;
  542. procedure _Write1Ext;
  543. procedure _Write0Ext;
  544. procedure _WriteLn;
  545.  
  546. procedure __CToPasStr;
  547. procedure __CLenToPasStr;
  548. procedure __ArrayToPasStr;
  549. procedure __PasToCStr;
  550.  
  551. procedure __IOTest;
  552. procedure _Flush(var F: Text);
  553.  
  554. procedure _SetElem;
  555. procedure _SetRange;
  556. procedure _SetEq;
  557. procedure _SetLe;
  558. procedure _SetIntersect;
  559. procedure _SetUnion;
  560. procedure _SetSub;
  561. procedure _SetExpand;
  562.  
  563. procedure _Str2Ext;
  564. procedure _Str0Ext;
  565. procedure _Str1Ext;
  566. procedure _ValExt;
  567. procedure _Pow10;
  568. procedure _Real2Ext;
  569. procedure _Ext2Real;
  570.  
  571. procedure _ObjSetup;
  572. procedure _ObjCopy;
  573. procedure _Fail;
  574. procedure _BoundErr;
  575. procedure _IntOver;
  576. procedure _StartExe;
  577. procedure _StartLib;
  578. procedure _PackageLoad  (const Table : PackageInfo);
  579. procedure _PackageUnload(const Table : PackageInfo);
  580. procedure _InitResStrings;
  581. procedure _InitResStringImports;
  582. procedure _InitImports;
  583.  
  584. procedure _ClassCreate;
  585. procedure _ClassDestroy;
  586. procedure _IsClass;
  587. procedure _AsClass;
  588.  
  589. procedure _RaiseExcept;
  590. procedure _RaiseAgain;
  591. procedure _DoneExcept;
  592. procedure _TryFinallyExit;
  593.  
  594. procedure _CallDynaInst;
  595. procedure _CallDynaClass;
  596. procedure _FindDynaInst;
  597. procedure _FindDynaClass;
  598.  
  599. procedure _LStrClr(var S: AnsiString);
  600. procedure _LStrArrayClr{var str: AnsiString; cnt: longint};
  601. procedure _LStrAsg{var dest: AnsiString; source: AnsiString};
  602. procedure _LStrLAsg{var dest: AnsiString; source: AnsiString};
  603. procedure _LStrFromPCharLen(var Dest: AnsiString; Source: PAnsiChar; Length: Integer);
  604. procedure _LStrFromPWCharLen(var Dest: AnsiString; Source: PWideChar; Length: Integer);
  605. procedure _LStrFromChar(var Dest: AnsiString; Source: AnsiChar);
  606. procedure _LStrFromWChar(var Dest: AnsiString; Source: WideChar);
  607. procedure _LStrFromPChar(var Dest: AnsiString; Source: PAnsiChar);
  608. procedure _LStrFromPWChar(var Dest: AnsiString; Source: PWideChar);
  609. procedure _LStrFromString(var Dest: AnsiString; const Source: ShortString);
  610. procedure _LStrFromArray(var Dest: AnsiString; Source: PAnsiChar; Length: Integer);
  611. procedure _LStrFromWArray(var Dest: AnsiString; Source: PWideChar; Length: Integer);
  612. procedure _LStrFromWStr(var Dest: AnsiString; const Source: WideString);
  613. procedure _LStrToString{(var Dest: ShortString; const Source: AnsiString; MaxLen: Integer)};
  614. function _LStrLen{str: AnsiString}: Longint;
  615. procedure _LStrCat{var dest: AnsiString; source: AnsiString};
  616. procedure _LStrCat3{var dest:AnsiString; source1: AnsiString; source2: AnsiString};
  617. procedure _LStrCatN{var dest:AnsiString; argCnt: Integer; ...};
  618. procedure _LStrCmp{left: AnsiString; right: AnsiString};
  619. procedure _LStrAddRef{str: AnsiString};
  620. procedure _LStrToPChar{str: AnsiString): PChar};
  621. procedure _Copy{ s : ShortString; index, count : Integer ) : ShortString};
  622. procedure _Delete{ var s : openstring; index, count : Integer };
  623. procedure _Insert{ source : ShortString; var s : openstring; index : Integer };
  624. procedure _Pos{ substr : ShortString; s : ShortString ) : Integer};
  625. procedure _SetLength{var s: ShortString; newLength: Integer};
  626. procedure _SetString{var s: ShortString: buffer: PChar; len: Integer};
  627.  
  628. procedure UniqueString(var str: string);
  629. procedure _NewAnsiString{length: Longint};      { for debugger purposes only }
  630.  
  631. procedure _LStrCopy  { const s : AnsiString; index, count : Integer) : AnsiString};
  632. procedure _LStrDelete{ var s : AnsiString; index, count : Integer };
  633. procedure _LStrInsert{ const source : AnsiString; var s : AnsiString; index : Integer };
  634. procedure _LStrPos{ const substr : AnsiString; const s : AnsiString ) : Integer};
  635. procedure _LStrSetLength{ var str: AnsiString; newLength: Integer};
  636. procedure _LStrOfChar{ c: Char; count: Integer): AnsiString };
  637.  
  638. procedure _WStrClr(var S: WideString);
  639. procedure _WStrArrayClr(var StrArray; Count: Integer);
  640. procedure _WStrAsg(var Dest: WideString; const Source: WideString);
  641. procedure _WStrFromPCharLen(var Dest: WideString; Source: PAnsiChar; Length: Integer);
  642. procedure _WStrFromPWCharLen(var Dest: WideString; Source: PWideChar; Length: Integer);
  643. procedure _WStrFromChar(var Dest: WideString; Source: AnsiChar);
  644. procedure _WStrFromWChar(var Dest: WideString; Source: WideChar);
  645. procedure _WStrFromPChar(var Dest: WideString; Source: PAnsiChar);
  646. procedure _WStrFromPWChar(var Dest: WideString; Source: PWideChar);
  647. procedure _WStrFromString(var Dest: WideString; const Source: ShortString);
  648. procedure _WStrFromArray(var Dest: WideString; Source: PAnsiChar; Length: Integer);
  649. procedure _WStrFromWArray(var Dest: WideString; Source: PWideChar; Length: Integer);
  650. procedure _WStrFromLStr(var Dest: WideString; const Source: AnsiString);
  651. procedure _WStrToString(Dest: PShortString; const Source: WideString; MaxLen: Integer);
  652. function _WStrToPWChar(const S: WideString): PWideChar;
  653. function _WStrLen(const S: WideString): Integer;
  654. procedure _WStrCat(var Dest: WideString; const Source: WideString);
  655. procedure _WStrCat3(var Dest: WideString; const Source1, Source2: WideString);
  656. procedure _WStrCatN{var dest:WideString; argCnt: Integer; ...};
  657. procedure _WStrCmp{left: WideString; right: WideString};
  658. function _NewWideString(Length: Integer): PWideChar;
  659. function _WStrCopy(const S: WideString; Index, Count: Integer): WideString;
  660. procedure _WStrDelete(var S: WideString; Index, Count: Integer);
  661. procedure _WStrInsert(const Source: WideString; var Dest: WideString; Index: Integer);
  662. procedure _WStrPos{ const substr : WideString; const s : WideString ) : Integer};
  663. procedure _WStrSetLength(var S: WideString; NewLength: Integer);
  664. function _WStrOfWChar(Ch: WideChar; Count: Integer): WideString;
  665. procedure _WStrAddRef{var str: WideString};
  666.  
  667. procedure _Initialize;
  668. procedure _InitializeArray;
  669. procedure _InitializeRecord;
  670. procedure _Finalize;
  671. procedure _FinalizeArray;
  672. procedure _FinalizeRecord;
  673. procedure _AddRef;
  674. procedure _AddRefArray;
  675. procedure _AddRefRecord;
  676. procedure _CopyArray;
  677. procedure _CopyRecord;
  678. procedure _CopyObject;
  679.  
  680. procedure _New;
  681. procedure _Dispose;
  682.  
  683. procedure _DispInvoke; cdecl;
  684. procedure _IntfDispCall; cdecl;
  685. procedure _IntfVarCall; cdecl;
  686.  
  687. procedure _VarToInt;
  688. procedure _VarToBool;
  689. procedure _VarToReal;
  690. procedure _VarToCurr;
  691. procedure _VarToPStr(var S; const V: Variant);
  692. procedure _VarToLStr(var S: string; const V: Variant);
  693. procedure _VarToWStr(var S: WideString; const V: Variant);
  694. procedure _VarToIntf(var Unknown: IUnknown; const V: Variant);
  695. procedure _VarToDisp(var Dispatch: IDispatch; const V: Variant);
  696.  
  697. procedure _VarFromInt;
  698. procedure _VarFromBool;
  699. procedure _VarFromReal;
  700. procedure _VarFromTDateTime;
  701. procedure _VarFromCurr;
  702. procedure _VarFromPStr(var V: Variant; const Value: ShortString);
  703. procedure _VarFromLStr(var V: Variant; const Value: string);
  704. procedure _VarFromWStr(var V: Variant; const Value: WideString);
  705. procedure _VarFromIntf(var V: Variant; const Value: IUnknown);
  706. procedure _VarFromDisp(var V: Variant; const Value: IDispatch);
  707. procedure _OleVarFromPStr(var V: OleVariant; const Value: ShortString);
  708. procedure _OleVarFromLStr(var V: OleVariant; const Value: string);
  709. procedure _OleVarFromVar(var V: OleVariant; const Value: Variant);
  710.  
  711. procedure _VarAdd;
  712. procedure _VarSub;
  713. procedure _VarMul;
  714. procedure _VarDiv;
  715. procedure _VarMod;
  716. procedure _VarAnd;
  717. procedure _VarOr;
  718. procedure _VarXor;
  719. procedure _VarShl;
  720. procedure _VarShr;
  721. procedure _VarRDiv;
  722. procedure _VarCmp;
  723.  
  724. procedure _VarNeg;
  725. procedure _VarNot;
  726.  
  727. procedure _VarClr;
  728. procedure _VarAddRef;
  729.  
  730. procedure _IntfClear(var Dest: IUnknown);
  731. procedure _IntfCopy(var Dest: IUnknown; const Source: IUnknown);
  732. procedure _IntfCast(var Dest: IUnknown; const Source: IUnknown; const IID: TGUID);
  733. procedure _IntfAddRef(const Dest: IUnknown);
  734.  
  735. function _VarArrayGet(var A: Variant; IndexCount: Integer;
  736.   Indices: Integer): Variant; cdecl;
  737. procedure _VarArrayPut(var A: Variant; const Value: Variant;
  738.   IndexCount: Integer; Indices: Integer); cdecl;
  739.  
  740. procedure _HandleAnyException;
  741. procedure _HandleOnException;
  742. procedure _HandleFinally;
  743. procedure _HandleAutoException;
  744.  
  745. procedure _FSafeDivide;
  746. procedure _FSafeDivideR;
  747.  
  748. procedure _CheckAutoResult;
  749.  
  750. procedure FPower10;
  751.  
  752. procedure TextStart;
  753.  
  754. (* =================================================================== *)
  755.  
  756. implementation
  757.